package com.yaoyao.ex;

import java.util.Random;
import java.util.Scanner;

public class arr_demo {
    public static void main(String[] args) {
        int[] arr = new int[5];
        int num = 0;
        int temp = 0;
        Random ra = new Random();
        int index = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入员工工号进行随机排序");
        for (int i = 0; i < 5; i++) {
            num = sc.nextInt();
            arr[i] = num;
        }
        for (int i = 0; i < arr.length; i++) {
            index = ra.nextInt(0, 5);
            temp = arr[i];
            arr[i] = arr[index];
            arr[index] = temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");

        }
    }
}
